package com.ITArmy.dao;

import com.ITArmy.beans.Comment;
import com.ITArmy.beans.Order;
import com.ITArmy.beans.Serialize;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface OrderMapper {
    int deleteByPrimaryKey(Long oId);

    //批量删除
    int deleteManyByIds(String[] ids);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Long oId);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    List<Order> selectAllOrder();

    List<Order> selectOrderByUid(Long uid);

    List<Order> selectOrderBySid(Long sid);

    List<Long> findSidByUid(long uid);

    /**
     * 通过uid和时间查找订单信息
     * @param uid uid
     * @param date date
     * @return int
     */
    Order findOrderByUidAndTime(@Param("uid") Long uid, @Param("date") Date date);

    /**
     * 查询是否购买过连载
     */
    Serialize isBy(@Param("uId")long uId,@Param("sId") long sId);
}